<?php
class Upload extends AppModel {
	var $name = 'Upload';
	var $actsAs = array(
        'FileUpload.FileUpload' => array(
          'uploadDir' => UPLOAD_PATH,
          'fields' => array('name' => 'file_name', 'type' => 'file_type', 'size' => 'file_size'),
          //'allowedTypes' => array('application/pdf')
        )
	);

	var $displayField = 'name';
	var $validate = array(
		'name' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'type' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
	);
	//The Associations below have been created with all possible keys, those that are not needed can be removed

//	var $hasMany = array(
//		'Yacht' => array(
//			'className' => 'Yacht',
//			'foreignKey' => 'upload_id',
//			'dependent' => false,
//			'conditions' => '',
//			'fields' => '',
//			'order' => '',
//			'limit' => '',
//			'offset' => '',
//			'exclusive' => '',
//			'finderQuery' => '',
//			'counterQuery' => ''
//		)
//	);


//	var $hasAndBelongsToMany = array(
//		'Yacht' => array(
//			'className' => 'Yacht',
//			'joinTable' => 'yacht_uploads',
//			'foreignKey' => 'upload_id',
//			'associationForeignKey' => 'yacht_id',
//			'unique' => true,
//			'conditions' => '',
//			'fields' => '',
//			'order' => '',
//			'limit' => '',
//			'offset' => '',
//			'finderQuery' => '',
//			'deleteQuery' => '',
//			'insertQuery' => ''
//		)
//	);

}
